package com.chenwut.stringBuilderDemo;

public class StringBuilderDemo {

    public static void main(String[] args) {
        //1.创建对象
        StringBuilder sb = new StringBuilder();

        //2.添加
        sb.append(1);
        sb.append("abc");
        sb.append(2.3);

        //3.反转
        sb.reverse();

        //4.获取长度
        int length = sb.length();
        System.out.println(length);
        //打印
        System.out.println(sb);
    }
}
